﻿using Microsoft.EntityFrameworkCore.Migrations;

namespace Core.DataAccess.Model.Migrations.ProjectInformation
{
    public partial class ProjectInformationContextInit : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropColumn(
                name: "InfoKey",
                table: "InformationType");

            migrationBuilder.RenameColumn(
                name: "TypeKey",
                table: "InformationType",
                newName: "TopKey");

            migrationBuilder.RenameColumn(
                name: "Content",
                table: "InformationType",
                newName: "Title");

            migrationBuilder.RenameColumn(
                name: "TypeKey",
                table: "InformationAttribute",
                newName: "Type");

            migrationBuilder.AddColumn<string>(
                name: "ProjectToken",
                table: "InformationType",
                nullable: true);

            migrationBuilder.AddColumn<int>(
                name: "UpKey",
                table: "InformationType",
                nullable: true);

            migrationBuilder.AddColumn<long>(
                name: "UserKey",
                table: "InformationType",
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "ProjectToken",
                table: "InformationHistory",
                maxLength: 21,
                nullable: true);

            migrationBuilder.AddColumn<int>(
                name: "Count",
                table: "InformationAttribute",
                nullable: false,
                defaultValue: 0);
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropColumn(
                name: "ProjectToken",
                table: "InformationType");

            migrationBuilder.DropColumn(
                name: "UpKey",
                table: "InformationType");

            migrationBuilder.DropColumn(
                name: "UserKey",
                table: "InformationType");

            migrationBuilder.DropColumn(
                name: "ProjectToken",
                table: "InformationHistory");

            migrationBuilder.DropColumn(
                name: "Count",
                table: "InformationAttribute");

            migrationBuilder.RenameColumn(
                name: "TopKey",
                table: "InformationType",
                newName: "TypeKey");

            migrationBuilder.RenameColumn(
                name: "Title",
                table: "InformationType",
                newName: "Content");

            migrationBuilder.RenameColumn(
                name: "Type",
                table: "InformationAttribute",
                newName: "TypeKey");

            migrationBuilder.AddColumn<int>(
                name: "InfoKey",
                table: "InformationType",
                nullable: false,
                defaultValue: 0);
        }
    }
}
